using FluentTests.Framework.VerbExtensions;
using FluentTests.NUnit;
using NUnit.Framework;

namespace FluentTests.Tests
{
    [TestFixture]
    public class NumericalTestsUsingNUnit
    {
        [Test]
        public void TestDoubleGreaterThan()
        {
            double a = 0.4;
            Ensure.That(a).Is.GreaterThan(0.34f);
        }

        [Test]
        public void TestDoubleNotGreaterThan()
        {
            double a = 0.4;
            Ensure.That(a).Is.Not.GreaterThan(0.44f);
        }

        [Test]
        public void TestFloatGreaterThan()
        {
            float a = 0.4f;
            Ensure.That(a).Is.GreaterThan(0.34f);
        }

        [Test]
        public void TestFloatLessThan()
        {
            float a = 0.4f;
            Ensure.That(a).Is.LessThan(0.54f);
        }

        [Test]
        public void TestFloatNotGreaterThan()
        {
            float a = 0.4f;
            Ensure.That(a).Is.Not.GreaterThan(0.44f);
        }

        [Test]
        public void TestFloatNotLessThan()
        {
            float a = 0.4f;
            Ensure.That(a).Is.Not.LessThan(0.34f);
        }

        [Test]
        public void TestIntIsGreater()
        {
            Ensure.That(4).Is.GreaterThan(3);
        }

        [Test]
        [ExpectedException(typeof (AssertionException))]
        public void TestIntIsGreaterFails()
        {
            Ensure.That(2).Is.GreaterThan(3);
        }

        [Test]
        [ExpectedException(typeof (AssertionException))]
        public void TestIntIsLessFails()
        {
            Ensure.That(5).Is.LessThan(4);
        }

        [Test]
        public void TestIntIsNotGreater()
        {
            Ensure.That(3).Is.Not.GreaterThan(4);
        }

        [Test]
        [ExpectedException(typeof (AssertionException))]
        public void TestIntIsNotGreaterFails()
        {
            Ensure.That(5).Is.Not.GreaterThan(4);
        }

        [Test]
        public void TestIntIsNotLess()
        {
            Ensure.That(5).Is.Not.LessThan(4);
        }

        [Test]
        [ExpectedException(typeof (AssertionException))]
        public void TestIntIsNotLessFails()
        {
            Ensure.That(3).Is.Not.LessThan(4);
        }

        [Test]
        public void TestIsEqual()
        {
            Ensure.That(3).Is.EqualTo(3);
        }

        [Test]
        [ExpectedException(typeof (AssertionException), ExpectedMessage = "Actual value is not equal to expected value")
        ]
        public void TestIsEqualFails()
        {
            Ensure.That(3).Is.EqualTo(4);
        }

        [Test]
        public void TestIsNotEqual()
        {
            Ensure.That(3).Is.Not.EqualTo(4);
        }


        [Test]
        public void TestNotZero()
        {
            Ensure.That(1).Is.Not.Zero();
        }

        [Test]
        [ExpectedException(typeof (AssertionException))]
        public void TestNotZeroFails()
        {
            Ensure.That(0).Is.Not.Zero();
        }

        [Test]
        public void TestNumbers()
        {
            Ensure.That(33).Is.LessThan(456);
            Ensure.That(33.56).Is.LessThan(33.88);
        }

        [Test]
        public void TestZero()
        {
            Ensure.That(0).Is.Zero();
        }

        [Test]
        public void TestZeroLong()
        {
            Ensure.That(0L).Is.Zero();
        }

        [Test]
        [ExpectedException(typeof (AssertionException))]
        public void TestZeroFails()
        {
            Ensure.That(1L).Is.Zero();
        }


        [Test]
        public void TestLongIsGreater()
        {
            Ensure.That(4L).Is.GreaterThan(3);
        }

        [Test]
        [ExpectedException(typeof(AssertionException))]
        public void TestLongIsGreaterFails()
        {
            Ensure.That(2L).Is.GreaterThan(3);
        }

        [Test]
        [ExpectedException(typeof(AssertionException))]
        public void TestLongIsLessFails()
        {
            Ensure.That(5L).Is.LessThan(4);
        }

        [Test]
        public void TestLongIsNotGreater()
        {
            Ensure.That(3L).Is.Not.GreaterThan(4);
        }

        [Test]
        [ExpectedException(typeof(AssertionException))]
        public void TestLongIsNotGreaterFails()
        {
            Ensure.That(5L).Is.Not.GreaterThan(4);
        }

        [Test]
        public void TestLongIsNotLess()
        {
            Ensure.That(5L).Is.Not.LessThan(4);
        }

        [Test]
        [ExpectedException(typeof(AssertionException))]
        public void TestLongIsNotLessFails()
        {
            Ensure.That(3L).Is.Not.LessThan(4);
        }

        [Test]
        [ExpectedException(typeof(AssertionException))]
        public void TestLongIsEqualFails()
        {
            Ensure.That(3L).Is.EqualTo(4);
        }

        [Test]
        public void TestLongIsEqual()
        {
            Ensure.That(4L).Is.EqualTo(4L);
        }

        [Test]
        [ExpectedException(typeof(AssertionException))]
        public void TestLongIsNotEqualFails()
        {
            Ensure.That(4L).Is.Not.EqualTo(4);
        }

        [Test]
        public void TestLongIsNotEqual()
        {
            Ensure.That(3L).Is.Not.EqualTo(4);
        }
    }
}